<header class="navbar">
  <nav class="navbar-inner">
    <%= render partial: 'layouts/logo_in' %>
    <div class="brand"></div>
    <!-- FIXME: search javascript functionality in 'layouts/search' -->

    <section class="quick-search">
      <%= form_tag search_path, method: 'get', id: "search-box", class: "navbar-search pull-left search-mobile" do %>
        <%= text_field_tag :q, nil, autocomplete: :off, class: "search-query-mobile input-small icon_tool16-searcher", placeholder: t('search.name'), "data-min_query" => SocialStream::Search::MIN_QUERY %>
      <% end %>
  
      <div class="search-nav hidden-phone hidden-tablet">
        <%= form_tag search_path, method: 'get', class: "navbar-search pull-left" do %>
          <%= text_field_tag :q, nil, autocomplete: :off, class: 'search-query input-small', placeholder: t('search.name'), "data-min_query" => SocialStream::Search::MIN_QUERY %>
        <% end %>
        <div class="mat">
          <%= render partial: 'layouts/loading' %>

          <div class="query_too_short">
            <%= t 'search.at_least', count: SocialStream::Search::MIN_QUERY %>
          </div>

          <div class="no_results">
            <%= t 'search.nothing' %>
          </div>

          <div class="results">
          </div>
        </div>
      </div>

      <%= javascript_tag do %>
        $(function() {
          SocialStream.SearchHeader.show();
        });
      <% end %>
    </section>

    <div class="explore-nav hidden-phone">
      <%= link_to explore_path do %>
    
        <%= t('explore.or') %>
      <% end %>

    </div>
     <ul class="nav pull-right">
      <li>
        <%= link_to current_subject do %>
          <%= image_tag current_subject.logo.url(:small), :class=>"user" %>
          <span class="name hidden-phone"><%= truncate_name(current_subject.name, length: 15) %></span>
        <% end %>
      </li>
      <li>
        <%= link_to root_path do %>
          <i class='icon_navbar-home <%= current_header_icon_class(:home) %>' title="<%= t 'header.icon.home' %>"></i>
        <% end %>
      </li>   
      <li>
        <%= link_to contacts_path do %>
          <i class='icon_navbar-contacts <%= current_header_icon_class(:contacts) %>' title="<%= t 'header.icon.contacts' %>"></i>
        <% end %>
      </li>
    
      <% if SocialStream.repository_models.present? %>
      <li>
      <%= link_to repository_path do %>
        <i class='icon_navbar-resources <%= current_header_icon_class(:resources) %>' title="<%= t 'header.icon.repository' %>" ></i>
      <% end %>
      </li>
      <% end %>
      <li>
        <%= link_to conversations_path do %> 
          <i class='icon_navbar-message <%= current_header_icon_class(:messages) %>' title="<%= t 'header.icon.messages' %>"></i>
        <% end %>
      </li>              
      <li> 
        <%= render partial: 'layouts/header_dropdown_menu' %>
      </li>
    </ul>
  </nav>
</header>
